<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>注册</title>
    <link href="css/register.css" rel="stylesheet">
</head>
<body>
<div class="form-div">
    <div class="reg-content">
        <h1>新闻管理注册页面</h1>
        <span>已有帐号点击:</span> <a href="login.jsp">登录</a>
    </div>
    <form id="reg-form" action="/moming/registerServlet" method="post">
        <table>
            <tr>
                <td>账号:</td>
                <td class="inputs">
                    <input name="username" type="text" id="username">
                    <br>
                    <span id="username_err" class="err_msg">${msg}</span>
                </td>
            </tr>
            <tr>
                <td>密码:</td>
                <td class="inputs">
                    <input name="password" type="password" id="password">
                    <br>
                    <span id="password_err" class="err_msg">${msg1}</span>
                </td>
            </tr>
            <tr>
                <td>验证码:</td>
                <td class="inputs">
                    <input name="checkCode" type="text" id="checkCode">
                    <img id="img" src="/moming/checkCodeServlet">
                    <a href="#" id="changeImg">看不清?</a>
                </td>
            </tr>
        </table>
        <div class="buttons">
            <input value="注 册" type="submit" id="reg_btn">
        </div>
        <br class="clear">
    </form>
</div>
<script>
    document.getElementById("changeImg").onclick = function () {
        /*解决浏览器缓冲问题*/
        let milliseconds = new Date().getMilliseconds();
        document.getElementById("img").src="/moming/checkCodeServlet?"+milliseconds;
    }
</script>
</body>
</html>